public class BankAccount {
    private String accountNumber;
    private String accountHolderName;
    private float balance;

    public BankAccount(String accountNumber, String accountHolderName, float balance) {
        this.accountNumber = accountNumber;
        this.accountHolderName = accountHolderName;
        this.balance = balance;
    }
    public void deposit(float amount){
        if(amount>0){
            System.out.println("存了"+amount+"元");
            //将存进来的钱加进去
            balance=balance+amount;
        }else {
            System.out.println("存款失败");
        }
    }

    public String getAccountNumber() {
        return accountNumber;
    }

    public String getAccountHolderName() {
        return accountHolderName;
    }

    public float getBalance() {
        return balance;
    }

    public void setBalance(float balance) {
        this.balance = balance;
    }
    public boolean isOverdrawn(){
        if(this.balance<=0){
            return true;
        }else{
            return false;
        }
    }
    public void isVIP(){
        if(balance>100000){
            System.out.println("该账户为VIP账户");
        }else{
            System.out.println("该账户为普通账户");
        }
    }
}
